package com.atom.process.cnmuseum.bm.dao.process;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Repository;

import com.atom.common.dao.AvensCommonDao;
import com.atom.common.mb.entity.gl.XzyxDO;
import com.atom.common.remote.user.UserUtil;
import com.atom.process.cnmuseum.bm.entity.process.BmXzyxProcessDO;

@Repository
public class BmXzyxProcessDao extends AvensCommonDao<BmXzyxProcessDO>{

	public void createPDO(UserUtil user, String processInstanceId, String biaoTi, XzyxDO xzwjxx) {
		// TODO Auto-generated method stub
        BmXzyxProcessDO pdo = new BmXzyxProcessDO();
        BeanUtils.copyProperties(xzwjxx, pdo, "id");
        pdo.setProcessId(processInstanceId);
        super.save(pdo);
	}

	public List<BmXzyxProcessDO> findByProcessInstanceIdAndFilesign(String processId, String filesign) {
		// TODO Auto-generated method stub
		Map<String, Object> xzvars = new HashMap<String, Object>();
		xzvars.put("processId", processId);
		xzvars.put("filesign", filesign);		
        List<BmXzyxProcessDO> list = super.findByProperties(xzvars);
        return list;
	}

}
